<% teams = [@sport.teams.all,:id,:name] %>
<%= error_messages_for :match %>
<% form_for [:admin,@match] do |f| %>

<p>
<label>sport</label>
<%= f.collection_select :sport_id,Sport.all,:id,:name,:include_blank=>"Please select" %>
</p>

<p>
<label>league</label>
<%= f.collection_select :league_id,League.all,:id,:name,:include_blank=>"Please select" %>
</p>

<p>
<label>Home team</label>
<%= f.collection_select :home_team_id,*(teams << {:include_blank=>"Please select"}) %>
</p>

<p>
<label>Away team</label>
<%= f.collection_select :away_team_id,*(teams << {:include_blank=>"Please select"}) %>
</p>

<p>
<label>point spread</label>
<%= f.text_field :point_spread %> eg: -3 , 3 
</p>

<p>
<label>total point</label>
<%= f.text_field :total_point %>
</p>

<p>
<label>begin at</label>
<%= f.datetime_select :begin_at %>
</p>

<p>
<label>bet type</label>
<%= f.select :bet_type,["spread","total"] %>
</p>

<p>
<label>&nbsp;</label>
<%= submit_tag "Submit",:class=>"button" %>
</p>

<% end %>
